package net.sk.china.city.controller;

import net.sk.china.city.domain.dto.analyse.RegionPoint;
import net.sk.china.city.service.IAnalyseService;
import net.sk.china.city.domain.dto.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static net.sk.china.city.domain.dto.AjaxResult.success;

@Api(tags = "大屏")
@RequiredArgsConstructor
@RestController
@RequestMapping("/data/analyse/grid")
public class AnalyseGridController {

    private final IAnalyseService analyseService;

    @ApiOperation("网格地图的坐标")
    @GetMapping("/region/level/list")
    public AjaxResult regionThisLeveList(Long reginId){
        List<RegionPoint> regionPointList = analyseService.thisRegionLeveList(reginId);
        return success(regionPointList);
    }

    @ApiOperation("镇街下网格的坐标")
    @GetMapping("/region/grid/list")
    public AjaxResult regionGridLeveList(Long townRegionId){
        List<RegionPoint> regionPointList = analyseService.gridLeveList(townRegionId);
        return success(regionPointList);
    }

    @ApiOperation("县区下网格坐标（网格图钉）")
    @GetMapping("/region/county/cell/list")
    public AjaxResult countyLevelCellList(Long countyRegionId) {
        List<RegionPoint> regionPointList = analyseService.countyLevelCellList(countyRegionId);
        return success(regionPointList);
    }


}
